#ifndef GLOBAL_H
#define GLOBAL_H

#include <config.h>

// Test for gettext
#ifdef HAVE_GETTEXT
#  include "gettext.h"
#  define _(STRING)  gettext(STRING)
#else
#  define _(STRING)  (STRING)
#endif
#define gettext_noop(String)  String

// TODO - test for stdbool
#ifdef HAVE_STDBOOL_H
#  include <stdbool.h>
#else
#  define _Bool unsigned char
#  define true  1
#  define false 0
#  define __bool_true_false_are_defined 1
#endif

// TODO - test for stdint.h

// colors
#define BLACK		  0
#define WHITE		  1
#define GREY		  2
#define STONE1         GREY
#define STONE2            3
#define STONE1_LG         4
#define STONE2_LG         5
#define STONE1_SH         6
#define STONE2_SH         7
#define CURSOR          254
#define TRANSPARENT	255

#define SET_PX(sf, x, y, val) \
	if((x) >= 0 && (x) < (sf)->w && (y) >= 0 && (y) < (sf)->h) \
		((Uint8*)sf->pixels)[(x)+((y)*(sf)->pitch)] = (val);

#include <sqlite3.h>
#include "SDL.h"
#include "SDL_ttf.h"
#include "SDL_image.h"

#include "ui.h"
#include "city.h"
#include "fct_translation.h"
#include "images.h"

typedef enum { PAUSED, SLOW, NORMAL, FAST } Speed;

extern _Bool debug;
extern SDL_Surface* screen;
extern SDL_Surface** images;
extern Speed game_speed;
extern _Bool full_screen;
extern sqlite3* db;
extern City* city;

#endif
